import mkTable from './table'
import Button from "components/items/button";
import copyright from "../../copyright"

const nav = Pager.nav
const {lib} = ao2
const bootstrapTable = mkTable()

function template(state, props) {
  return (
    <>
      <View className='ss-card pages-title-lg'>订单列表</View>
      <View className='ss-card m-default'>
        <View id='toolbar' className='row-flex'>
          <Button title='添加' itemClass='btn-default' tap={this['onAdd']} />
          <Button title='删除' itemClass='btn-default ml-default' tap={this['onAdd']} />
        </View>
        <bootstrapTable.UI />
      </View>
      <copyright.UI />
    </>
  )
}

export default function(Pager) {
  return Pager({
    template,
    data: {
      tipsList: []
    },
    onAdd() {
      nav.redirectTo({
        url: '/order/detail',
        beforeNav(to, from, next) {
          next()
        }
      })
    }
  })
}